package com.kitbox.hl.meshow.common.utils.datetime;

public class TimeFormater {

    public static String timeFormaterByString(String time) {
        String year;
        String month;
        String day;
        String hour;
        String minute;
        String second;
        String result = "";
        if(time.length()>=4) {
            year = time.substring(0, 4);
            result +=  year;
        }
        if(time.length()>=6){
            month = time.substring(4,6);
            result += "-" + month;
        }
        if(time.length()>=8) {
            day = time.substring(6, 8);
            result += "-" + day;
        }
        if(time.length()>=10) {
            hour = time.substring(8, 10);
            result += " " + hour;
        }
        if(time.length()>=12) {
            minute = time.substring(10, 12);
            result += ":" + minute ;
        }
        if(time.length()>=14) {
            second = time.substring(12, 14);
            result += ":" + second;
        }
        return result;

    }



}
